<?php
namespace Admin\Controller;
use Admin\Controller\AdminController;
use Libs\Logs;

class PublicController extends AdminController{
    function _initialize() {
        parent::_initialize();
    }

    public function dataajax(){
        $goods_comment['reply'] = null;
        $goods_comment['user_id'] = array('neq',0);
        $goods_comment['rec_id'] = array('neq',0);
        $goods_comment_num = M('goods_comment')->where()->count();

        $order['refund_state'] = array('neq',2);
        $order['order_state'] = 20;
        $order['lock_state'] = 0;
        $order['delete_state'] = 0;
        $order_num = M('order')->where($order)->count();

        $advice['user_id'] = array('neq',0);
        $advice['reply'] = null;
        $advice_num = M('advice')->where($advice)->count();

        $html = "";

        $html .= "<p><a href='".ADMIN_URL."/Comment/index'>未回复的评论：{$goods_comment_num}条</a></p>";
        $html .= "<p><a href='".ADMIN_URL."/Order/index'>未发出的订单：{$order_num}条</a></p>";
        $html .= "<p><a href='".ADMIN_URL."/Advice/index'>未回复的咨询：{$advice_num}条</a></p>";

        $arr['a'] = true;
        $arr['b'] = $html;

        $this->ajaxReturn($arr);

    }

}
